<template>
    <MSearch @focus="searchFocus" :placeholders="recentHotSearchTags"></MSearch>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { getRecentHotSearch } from '@/api/home'
import MSearch from '@/components/common/MSearch.vue'

const recentHotSearchTags = ref<string[]>()
getRecentHotSearch().then((res) => {
    recentHotSearchTags.value = res.data || []
})
function searchFocus(val: string) {
    uni.navigateTo({ url: '/pages/search/index?val=' + val })
}
</script>
